<template>
    <div class="list_page_div">
        <page-list :loading="loading" :table-config="tableConfig" :data-list="dataList" :height="height" show-index
                   show-page :total="total" :currentPage="param.pageNum" :pageSize="param.pageSize" @currentChange="handleCurrentChange"
                   search-btn="none">
        </page-list>
    </div>
</template>

<script>
import PageList from "@/components/grid/pageList.vue";

export default {
    name: "sequenceList",
    components: {PageList},
    data() {
        return {
            height: '500px',
            loading: false,

            tableConfig: [
                {label: "序号编号", prop: "seqCode", width: 220},
                {label: "序号名称", prop: "seqName", minWidth: 320},
                {label: "最小值", prop: "minValue", width: 200},
                {label: "最大值", prop: "maxValue", width: 200},
                {label: "起始位置", prop: "startNum", width: 200},
            ],
            dataList: [],
            total: 0,
            param: {
                field: 'seq_code',
                order: 'asc',
                pageSize: 20,
                pageNum: 1,
            },
        }
    },
    mounted() {
        this.$nextTick(() => {
            this.height = (document.body.offsetHeight - 135) + "px";
        })
        this.searchList();
    },
    methods: {
        handleCurrentChange(val) {
            this.param.pageNum = val;
            this.searchList();
        },
        resetData() {
            this.param.pageNum = 1;
            this.searchList();
        },
        searchList() {
            this.loading = true;
            this.$axios.post("/CHILD_SYSTEM/baseSequence/getPageList", this.param).then(res => {
                this.total = res.data.total;
                this.dataList = res.data.rows;
            }).finally(() => {
                this.loading = false;
            })
        },
    }
}
</script>

<style scoped>

</style>